﻿function CXml(pTagName, pPairValues) {
    this.tagName = pTagName;
    this.pairValues = pPairValues;

    this.init = function () {

    }
    this.getXml = function () {
        var self = this;
        var node = '<' + self.tagName + ' [ATTRIBUTE]/>';
        var sAttribute = '';
        try {
            $.each(self.pairValues, function (attName, attValue) {
                var value = $.FormatHTMLEscape(attValue);
                if (value != null && value != 'null' && value != undefined && value != 'undefined') {
                    sAttribute += attName + '="' + value + '" ';
                }
            });
        }
        catch (e) {
            if (typeof console != "undefined")
                console.log('::ERROR CXML.getXml', e);
        }
        node = node.replace('[ATTRIBUTE]', sAttribute)
        return node;
    }
};